home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMICUS08.ADF / Scrimper / Messages < prev    next >
Text File  |  1986-04-02  |  19KB  |  408 lines

  1.  
  2.     Hey friends! This month we have to begin with the great news that
  3. CBM has secured a refinancing of their  debt which will ensure their fin-
  4. ancial integrity well into next year. This means it's up to us now. We as
  5. developers have the responsibility  of  turning  out quality products for
  6. public consumption. We as consumers have the  responsibility of demanding
  7. excellence from the  manufacturers  of  Amiga  products.  We all know the
  8. Amiga personal computer is a leading edge product of high quality.
  9.  
  10.     One thing that has been a  recurring  obstacle  to the market ac-
  11. ceptence of the Amiga is prevailing  unjustified  negative press. Column-
  12. ists in many of the trades dismiss the Amiga as  an inconsequential entry
  13. by that long  standing producer  of  toy computers. They can't see beyond
  14. their monochrome, low  resolution,  low  performance,  non-expandable Big
  15. Banannas. I really  get  the impression  that  manufacturers in the staid
  16. world of yesterday's  technology  have banded together to turn their col-
  17. lective back against  a  product  that simply represents the bell tolling
  18. the end of their reign of mediocre machines for the mass market.
  19.  
  20.     Conspiracy? Just might be possible. Big advertising budgets often
  21. dictate editorial policy. The really mind blowing thing is that Commodore
  22. has not been combatting the Amiga-Blahs in the press with persuasive arg-
  23. uments to  the  contrary. Where's  the  Amiga advertising budget gone? Is
  24. there one? How come such things as a recent  ad from a  mass-merchandiser
  25. of the Atari ST attirbuted the characteristics of  the Amiga to the Atari
  26. the the specifications and  characteristics  of the Atari to the Amiga go
  27. uncontested?
  28.  
  29.     So, you might be asking where's Perry going  with all this? Well,
  30. I spoke of responsibilities   before.  We've  all  got one very important
  31. responsibility that we've got  to  start picking up upon. That is, WE can
  32. help create a better informed  public  which  up till now has not had the
  33. benifit of balanced coverage of the Amiga personal computer. 
  34.  
  35. CBM's financial security will last a  year. Without  us  to  counter  the
  36. prevailing misunderstandings  by  the  public  the year will come and go.
  37. We've got to make the product  stick. We've got to demonstrate  to others
  38. what we've seen ourselves. The Amiga is a technologically  superior prod-
  39. uct offering enough performance and features to finally make the personal
  40. computer a powerful,  effective  tool providing an adequate human-machine 
  41. interface.
  42.  
  43.     What can we do? Simple! Write letters to editors saying:
  44.  
  45.     o    ``How come you don't mention or cover the Amiga in your
  46.         publication?''
  47.  
  48.     o    ``Your articles/editorial/advertisement did not repres-
  49.         ent the truth sufficiently.  Let  me correct you on the
  50.         following points:''
  51.  
  52.     And, we can talk. The prevailing views we have to combat are:
  53.  
  54.     o    CBM cannot produce a quality product. Or, CBM: Don't they
  55.         make toys?
  56.  
  57.         It's funny. But, in Europe, CBM  enjoys the opposite rep-
  58.         utation. They are THE business machine maker. At the very
  59.         least you can  always  say:  ``But CBM didn't produce the
  60.         technology. Amiga (a Californian start-up) did.''
  61.  
  62.     o    The Amiga doesn't have an IBM-PC emulation.
  63.  
  64.         Not true. There are currently  two  PC emulation products
  65.         available which work quite  well.  CBM's commitment is to
  66.         have the top 25 IBM  PC  business packages running on the
  67.         Amiga.
  68.  
  69.     o    The Amiga is not a serious business computer.
  70.  
  71.         Why? Because it can take 8.5 megabytes of memory directly?
  72.         Maybe it's because its c.p.u. offers nearly the same per-
  73.         formance as computers in  the  100  to 200 thousand dollar
  74.         range? And those  machines  don't  have  the same level of
  75.         hardware support for graphics and sound.  Yeah, maybe it's
  76.         because the Amiga can compute and render hundreds of thou-
  77.         sands of graphics elements  per  second.  A  real business
  78.         environment can't possibly benifit from such things.
  79.  
  80.     So? Let's Get Tough!
  81.  
  82. User Group Information #2 --- News From JAUG
  83.  
  84.     This is the last month I expect to relay news from the Jersey Amiga
  85. User Group for a while since (hint hint) readers  will start sending infor-
  86. mation about their user groups and meetings to AC for publication here. You
  87. can send information about your local group to:
  88.  
  89. USMail:        Miga-Mania
  90.         c/o Amazing Computing
  91.         PiM Publications Inc.
  92.         P.O. Box 869
  93.         Fall River, Ma. 02722
  94.  
  95. Usenet:        ihnp4!ptsfa!well!perry
  96.  
  97. Compuserve:    Don Hicks 76714,2404
  98.  
  99.     The February 21st meeting of JAUG was attended by approximately 240
  100. people. We were treated to demonstrations of Amiga music products by Cherry
  101. Lane Technologies, Inc. as well as two demonstrations  of  MIDI wizardry by
  102. Lou Ploch of Micro-W Distributing. In fact, we heard a  few Rag Time pieces
  103. played in Scott Joplin's  own  hand (and  recorded  by piano rolls) by MIDI
  104. synthesizers controlled by an Amiga personal computer.
  105.  
  106.     Next month's focus will be  upon  business software as well as upon
  107. repair and service of the Amiga. Representatives  from  Commodor-Amiga will
  108. be present for the answering of questions.
  109.  
  110.     The meeting will be held Friday, the 21st at 7:30. Lecture hall 114
  111. of Hill Center, Rutgers University New Brunswick campus. Hill Center is off
  112. of Brett Rd which is off of Metlars  Lane  which  is  off of River Rd which
  113. intersects Route 287 at exit 5 (consult a New Jersey map).
  114.  
  115. General Helpful Advice #4 --- Amiga RFI (Radio Frequency Interference)
  116.  
  117.     Anyone who has ever opened up their Amiga personal computer  to see
  118. what was inside was greeted by yet another sealed box made of metal. Inside
  119. the plastic case is a metal case whose purpose is to contain radio frequen-
  120. cy interference caused by the Amiga and prevent such interference from  im-
  121. pacting other home products such as radios, t.v.'s and your home's electri-
  122. cal system.
  123.  
  124.     The shielding can only be effective if your Amiga is connected to a
  125. fully grounded electrical source. If your Amiga is  not  fully grounded you
  126. will definately experience interference caused by  the  Amiga on other home
  127. appliances. 
  128.  
  129.     Moreover, intereference caused by an improperly grounded Amiga  may
  130. even cause what  appears  to  be  disk errors when reading from the Amiga's
  131. floppy disks. These errors (on reading) will  go  away when the computer is
  132. properly grounded. If, however, you  write to a disk drive using an improp-
  133. erly grounded machine, you might be writing bad information. Errors of this
  134. sort will not go away.
  135.  
  136.     By the way, if you are using an adapter  to connect your Amiga to a
  137. two conductor electrical outlet, you're definately not grounded.
  138.  
  139.     In summary, if you can use  your  Amiga  without noticing any noise
  140. over televisions or stereos  running  at the same time, you're probably ok.
  141. Also, if you experience a lot of disk  failures check to see if you do have
  142. interference on a  t.v. or radio. If so, your problems may be caused by im-
  143. proper grounding.
  144.  
  145. Intuition #3 --- Messages and Message Ports
  146.  
  147.     Although this note is grouped under  the  heading of ``Intuition,''
  148. its scope encompasses any instance of messages and message port usage.
  149.  
  150.     One of the primary means of interprocess communication on the Amiga
  151. personal  computer is the message. Messages can contain arbitrary informat-
  152. ion. For example, a message may be empty.  It relays information simply  by
  153. arriving at some destination. Or, a message may contain a C language struc-
  154. ture specifying, for example, the position of the mouse with repect  to the
  155. upper left corner of a window. 
  156.  
  157.     Because the programmer  has  complete control over the content of a
  158. message, message passing can be used to convey any kind of information from
  159. one task or process to another. 
  160.  
  161.     One way programmers will routinely use messages and message passing
  162. is doing  device  i/o. On the Amiga, processes don't themselves do physical
  163. i/o. That is, processes themselves  don't  normally  have to diddle machine 
  164. registers to make an i/o go. Instead, a process opens a device (which makes
  165. sure that a device handler exists and is  loaded  into  memory),  formats a
  166. (device specific) message, then passes the  message  to the device handler.
  167. The device handler is a piece  of  code  written specifically to handle the
  168.  grungy details  of  controlling  some  device so that we won't have to. Our 
  169. interaction with devices  is  accomplished  via  a nice clean message based
  170. interface.
  171.  
  172.     Messages are things which are passed from one place to another. So,
  173. we should first talk about how to set up a message destination.
  174.  
  175.     Message are sent from a process to a ``Message Port'' (or simply, a
  176. ``port''). Another  process  reads  the message from the port and sometimes
  177. will reply to the message (sending  a  message back to the originating task
  178. or process). So, a message  port  is  a message destination. If you wish to
  179. send a message to someother  process  you must locate its port. If you wish
  180. to receive messages (or replies  to  your  own messages) you must declare a
  181. message port of your own. 
  182.  
  183.     To create a port use the call  CreatePort  supplied in the standard
  184. Amiga library.
  185.  
  186.     Synopsis:    struct MsgPort *CreatePort(name , priority);
  187.             char *name;
  188.             char priority;
  189.  
  190. This means that CreatePort returns a pointer to a structure of type MsgPort.
  191. The arguments are a pointer to a string which represents the port's name and
  192. a byte representing the priority of the port.
  193.  
  194.     A port  should be given a name when you want to make the port ``pub-
  195. lic.'' That is, your desire is to have many different processes or tasks all
  196. use the same message port for communication. For example, you might define a
  197. message port over which all requests for a data base search  might be routed
  198. to a data base access program. The data base manager declares  the  port and
  199. gives it a name  (which when  using  CreatePort will automatically make it a 
  200. public port). Programs which wish to use the data base manager will look for
  201. its message port (using FindPort) via the predefined name.
  202.  
  203.     When doing defice i/o,  a  public  message is not needed since their
  204. will be only two specific parties to  the  message communication. These are:
  205. your process and the device handler.
  206.  
  207.     The  priority  field passed to the CreatePort call is used to influ-
  208. ence where in the list of all public message ports this port will be insert-
  209. ed. If you are  not  providing  a name for  the message port then there's no
  210. need to set this field to anything other than 0. If a priority is given, the
  211. message port will be inserted no further down the list than the last message
  212. port having the same priority. 
  213.  
  214.     In the grand scheme  of  things,  a  message port's priority doesn't
  215. really affect performance all that much.
  216.  
  217.     CreatePort creates a message port configured to cause a signal to be
  218. sent to your task  or  process each time a message is sent to the port. Sig-
  219. nals are another form of interprocess  communication (IPC)  available on the
  220. Amiga. They  are used (in this case) to  notify  a  process  that  there  is
  221. something interesting waiting for it on a message port. CreatePort  performs
  222. the Amiga calls to allocate a signal and tells you which signal will be used
  223. by this message port in the field ``mp_SigBit.'' You could use this to allow
  224. your process to sleep (not  use  c.p.u.) when  it is waiting for activity on
  225. the message port like so:
  226.  
  227.                      Wait(1L << myport->mp_SigBit);
  228.  
  229. That is, wait for a  signal  whose number is mp_SigBit. Other signals can be
  230. ``or'ed'' into a  Wait call to allow your process to woken up for any one of
  231. several signals.
  232.  
  233.     Now, having  called CreatePort, you've  got a port set up. This port
  234. might be used as  a  destination  of  replies  sent as a consequence of your
  235. sending messages to someplace else, or  your  port  might be used as a dest-
  236. ination for messages other  process  might  want to send you (by the way: if
  237. you need to reply to a message  sent to you, the message port to reply to is
  238. contained in the message you receive). The next step is to send a message.
  239.  
  240.     A message has the following form:
  241.  
  242.             +-------------------------------+
  243.             | standard Amiga message header |
  244.             +-------------------------------+
  245.             |  user defined data structure  |
  246.             +-------------------------------+
  247.  
  248.     There is a field in the standard Amiga message header which  defines
  249. the length of the user defined  data to  follow.  The Amiga message handling
  250. routines are not concerned with the  content  of the user defined data area.
  251. This area is completely dependent upon the programmer for defninition, mean-
  252. ing and usage.
  253.  
  254.     Here's an example of a user defined message which might be sent from
  255. some process to a data base manager:
  256.  
  257.         struct DBMS_message {
  258.             struct Message m;
  259.             struct DBMS_data d;
  260.         } db_message;
  261.  
  262. where ``m'' is an instance of the standard Amiga message header and ``d'' is
  263. a structure defined and understood  by  both  the  program and the data base
  264. manager.
  265.  
  266.     Before using db_message, we'd specify how many bytes of data were in
  267. the message by saying:
  268.  
  269.         db_message.m.mn_Length = sizeof(struct DBMS_data);
  270.  
  271.     If a reply from the data base manager  is  required, we also have to
  272. specify a port of our own creation  to  act  as  a destination for the reply
  273. message sent by the data base manager back to us.
  274.  
  275.         /* previously createported a message port
  276.            whose pointer is in ``myport''
  277.         */
  278.         db_message.m.mn_ReplyPort = myport;
  279.  
  280.     We use the PutMsg call to send a message. PutMsg takes  a pointer to
  281. the destination port and a pointer to the message to be sent. Notice, in our
  282. example of a process talking to a data base manager, two ports are envolved.
  283. Your process had to do a  FindPort  to  find the public message port used by
  284. the data base manager  as  a  collection point for messages to the data base
  285. manager. Also, you had to CreatePort your own port to be used as the destin-
  286. ation of any reply messages sent from the data base manager back to you.
  287.  
  288.     Synopsis:    PutMsg(port , mesg)
  289.             struct MsgPort *port;
  290.             /* mesg is a pointer to an instance of your
  291.                application specific  message  structure
  292.             */
  293. One really important characteristic of the kind of message passing the Amiga
  294. employs is that once you have called PutMsg, you  must promise not to modify
  295. the contents of the message. In fact,  you shouldn't even read from the mes-
  296. sage after calling PutMsg since the contents may be undefined. 
  297.  
  298.     Once you've received  your  reply  you're free once again to use and
  299. modify the message structure and  contents. Think of it this way: By calling
  300. PutMsg you are lending the memory  in which the message sits to another pro-
  301. cess. If you were to modify that memory  while the other process beleives it
  302. has control of the memory you  might  be screwing something up. Also, if the
  303. other process modifies the memory, it might be over writing some information
  304. you thought was still valid. The reply is the  other  process'es way of sig-
  305. nifying you that it is done using the memory you loaned it.
  306.  
  307.     This restriction (of not referencing the contents of a message until
  308. you've received  a  reply for it) is a general rule and may not apply in all
  309. cases. However, it pays not to violate the restriction even if you think you
  310. might be able to get  away  with it (something about not tempting fate might
  311. be in order here).
  312.  
  313.     You can get a message by calling  GetMsg and furnishing a pointer to
  314. the message port you wish to interrogate. If a  message is available for you
  315. on the supplied port, GetMsg returns a pointer to the message structure.  If
  316. there is no message waiting for you  at  the  time on the given port, GetMsg
  317. will return NULL.
  318.  
  319.     Usually you'll be sitting in some Wait call.  When a message arrives
  320. for you on one of the message ports whose signal bit you've specified in the
  321. argument to Wait, the Wait call will return. Then you'd call GetMsg for each
  322. of the possible message sources.  The WaitPort call  may also be used if you
  323. are going to wait for activity from exactly one source.
  324.  
  325.     Replying to a message is  accomplished via  the  ReplyMsg call. This
  326. call is passed a pointer  to  a  user  defined message. The standard message
  327. header field ``mn_ReplyPort'' must have been initialized to be the destinat-
  328. ion port for replies.
  329.  
  330.     Synopsis:    ReplyMsg(mesg)
  331.  
  332.     In our data base manager example, your process  might send a message
  333. to the data base manager requesting  that a specific record be searched for.
  334. The data base manager would perform  the  search and if the record was found
  335. load it into the space reserved  for  it in the user defined message sent by
  336. your process. If the  record  was  not found the data base manager could set
  337. some flag which would  be  checked  by your process before trying to use the
  338. data returned by the data base manager.
  339.  
  340.     While the data base manager  performed  its work, your process would
  341. be waiting for a reply. When  the  reply  comes, it means that the data base
  342. manager if finished processing  your  request  and that you can now find the
  343. results in the data structure your had originally passed.
  344.  
  345.     Here's a summary of  how  to  set  up two processes sending messages
  346. back and forth.  One process is a server (like a data base manager) and will
  347. not generate messages on its own  but  only  reply to messages sent to it by
  348. other processes.
  349.  
  350.     Your Process                Server
  351.     ------------                ------
  352.     1. start-up                1. start-up
  353.                         2. declare public
  354.                            message port named
  355.                            Ralph
  356.     3. Look for public message port        3. Wait for message on
  357.        named Ralph                   Ralph
  358.     4. Declare private message port
  359.        (no name but call it myport)
  360.     5. Declare message (call it mymess).
  361.        Mymess has standard message header
  362.        called m as one field.
  363.     6. mymess.m.mn_Length = sizeof(user defined data area)
  364.     7. mymess.m.mn_ReplyPort = myport;
  365.     8. mymess.user_definable data gets stuff.
  366.     9. PutMsg(ralph,&mymess)
  367.     10. Wait(1L << myport->mp_SigBit);
  368.                         4. Server wakes up.
  369.                         5. msg = GetMsg(ralph);
  370.                         6. process message
  371.                         7. formulate reply
  372.                         8. ReplyMsg(msg);
  373.     11. Process wakes up.            9. goto 3.
  374.     12. (void) GetMsg(myport);
  375.     13. Look at results.
  376.     14. goto 8.
  377.  
  378. AmigaDos Bugs #2 - Early Versions Of Delux Paint Will Eat Themselves
  379.  
  380.     This isn't really an AmigaDos bug, but we'll put it under this head-
  381. ing to reduce the proliferation of Miga-Mania topics. Early versions of Elec-
  382. tronic Arts' program Delux Paint may  destroy themselves  if they are written
  383. upon. What happened is EA didn't know that when a disk fills up, the free map
  384. of the disk is thrown away and a new one is recontructed at a later time. The
  385. problem is that when the free block map is  recreated, AmigaDos tries reading
  386. the bad  sectors  EA  places  on each disk to implement their copy protection 
  387. scheme. Ordinarily, the sectors wouldn't be considered but since the old free
  388. map was tossed away the information saying not to try to access the bad sect-
  389. ors is lossed. Poor AmigaDos recoils  in  horror upon trying to validate your
  390. once full Delux Paint disk.
  391.  
  392.     Result: Dpaint become Dpain.
  393.  
  394.     If your version of Delux Paint ever gives out, don't hesitate to send
  395. it back for replacement  by  EA. They'll be glad  to replace any disk damaged
  396. by this error.
  397.  
  398.     -------------------------------------------------------------
  399.  
  400. Well, that's all for this month. Be  sure  to  catch the Screen Image Printer
  401. included in this issue. The note on message  passing  was intended to lay the
  402. ground work for a discussion next month on how SCRIMPER  works (specifically,
  403. how to do screen dumps).
  404.  
  405.     Be well everybody and remember to become militant with respect to bad
  406. media coverage of the Amiga!
  407.  
  408.